﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RPGSoundmixerGUI.Forms.Dialogs {
    public partial class OptionsForm : Form {
        
        /// <summary>
        /// Der ausgewählte Pfad
        /// </summary>
        public string dbPath { get; set; }

        /// <summary>
        /// Temporärer DB Pfad
        /// </summary>
        private string tempDbPath { get; set; }

        /// <summary>
        /// Constructor
        /// </summary>
        public OptionsForm() {
            InitializeComponent();
        }

        /// <summary>
        /// Abbrechen Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e) {
            this.Close(); 
        }

        /// <summary>
        /// OK Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e) {
            this.dbPath = tempDbPath;
            this.Close(); 
        }

        /// <summary>
        /// File Open Handler
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e) {
            FileDialog fd = new OpenFileDialog(); 
            DialogResult dr = fd.ShowDialog();
            if(dr.Equals(DialogResult.OK)){
                this.tempDbPath = fd.FileName;
                this.textBox1.Text = fd.FileName; 
            }            
        }
    }
}
